\(\int \frac {\cot ^2(x)}{(a+a \tan ^2(x))^{3/2}} \, dx\) [282]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 17, antiderivative size = 60 \[ \int \frac {\cot ^2(x)}{\left (a+a \tan ^2(x)\right )^{3/2}} \, dx=-\frac {\csc (x) \sec (x)}{a \sqrt {a \sec ^2(x)}}-\frac {2 \tan (x)}{a \sqrt {a \sec ^2(x)}}+\frac {\sin ^2(x) \tan (x)}{3 a \sqrt {a \sec ^2(x)}} \]

[Out]

-csc(x)*sec(x)/a/(a*sec(x)^2)^(1/2)-2*tan(x)/a/(a*sec(x)^2)^(1/2)+1/3*sin(x)^2*tan(x)/a/(a*sec(x)^2)^(1/2)

Rubi [A] (verified)

Time = 0.16 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.235, Rules used = {3738, 4210, 2670, 276} \[ \int \frac {\cot ^2(x)}{\left (a+a \tan ^2(x)\right )^{3/2}} \, dx=-\frac {\csc (x) \sec (x)}{a \sqrt {a \sec ^2(x)}}-\frac {2 \tan (x)}{a \sqrt {a \sec ^2(x)}}+\frac {\sin ^2(x) \tan (x)}{3 a \sqrt {a \sec ^2(x)}} \]

[In]

Int[Cot[x]^2/(a + a*Tan[x]^2)^(3/2),x]

[Out]

-((Csc[x]*Sec[x])/(a*Sqrt[a*Sec[x]^2])) - (2*Tan[x])/(a*Sqrt[a*Sec[x]^2]) + (Sin[x]^2*Tan[x])/(3*a*Sqrt[a*Sec[
x]^2])

Rule 276

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*(a + b*x^n)^p,
 x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0]

Rule 2670

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> Dist[-f^(-1), Subst[Int[(1 - x^2
)^((m + n - 1)/2)/x^n, x], x, Cos[e + f*x]], x] /; FreeQ[{e, f}, x] && IntegersQ[m, n, (m + n - 1)/2]

Rule 3738

Int[(u_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Int[ActivateTrig[u*(a*sec[e + f*x]^2)^p]
, x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a, b]

Rule 4210

Int[(u_.)*((b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_), x_Symbol] :> With[{ff = FreeFactors[Sec[e + f*x], x]}, Di
st[(b*ff^n)^IntPart[p]*((b*Sec[e + f*x]^n)^FracPart[p]/(Sec[e + f*x]/ff)^(n*FracPart[p])), Int[ActivateTrig[u]
*(Sec[e + f*x]/ff)^(n*p), x], x]] /; FreeQ[{b, e, f, n, p}, x] &&  !IntegerQ[p] && IntegerQ[n] && (EqQ[u, 1] |
| MatchQ[u, ((d_.)*(trig_)[e + f*x])^(m_.) /; FreeQ[{d, m}, x] && MemberQ[{sin, cos, tan, cot, sec, csc}, trig
]])

Rubi steps \begin{align*} \text {integral}& = \int \frac {\cot ^2(x)}{\left (a \sec ^2(x)\right )^{3/2}} \, dx \\ & = \frac {\sec (x) \int \cos ^3(x) \cot ^2(x) \, dx}{a \sqrt {a \sec ^2(x)}} \\ & = -\frac {\sec (x) \text {Subst}\left (\int \frac {\left (1-x^2\right )^2}{x^2} \, dx,x,-\sin (x)\right )}{a \sqrt {a \sec ^2(x)}} \\ & = -\frac {\sec (x) \text {Subst}\left (\int \left (-2+\frac {1}{x^2}+x^2\right ) \, dx,x,-\sin (x)\right )}{a \sqrt {a \sec ^2(x)}} \\ & = -\frac {\csc (x) \sec (x)}{a \sqrt {a \sec ^2(x)}}-\frac {2 \tan (x)}{a \sqrt {a \sec ^2(x)}}+\frac {\sin ^2(x) \tan (x)}{3 a \sqrt {a \sec ^2(x)}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.52 \[ \int \frac {\cot ^2(x)}{\left (a+a \tan ^2(x)\right )^{3/2}} \, dx=\frac {\sec ^3(x) \left (-3 \csc (x)-6 \sin (x)+\sin ^3(x)\right )}{3 \left (a \sec ^2(x)\right )^{3/2}} \]

[In]

Integrate[Cot[x]^2/(a + a*Tan[x]^2)^(3/2),x]

[Out]

(Sec[x]^3*(-3*Csc[x] - 6*Sin[x] + Sin[x]^3))/(3*(a*Sec[x]^2)^(3/2))

Maple [A] (verified)

Time = 0.28 (sec) , antiderivative size = 32, normalized size of antiderivative = 0.53

method result size
default \(\frac {\cos \left (x \right )^{2} \cot \left (x \right )+4 \cot \left (x \right )-8 \sec \left (x \right ) \csc \left (x \right )}{3 \sqrt {a \sec \left (x \right )^{2}}\, a}\) \(32\)
risch \(\frac {i \left (20 \,{\mathrm e}^{4 i x}+{\mathrm e}^{6 i x}+20-89 \cos \left (2 x \right )-91 i \sin \left (2 x \right )\right )}{24 a \left ({\mathrm e}^{2 i x}+1\right ) \sqrt {\frac {a \,{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}+1\right )^{2}}}\, \left ({\mathrm e}^{2 i x}-1\right )}\) \(70\)

[In]

int(cot(x)^2/(a+a*tan(x)^2)^(3/2),x,method=_RETURNVERBOSE)

[Out]

1/3/(a*sec(x)^2)^(1/2)/a*(cos(x)^2*cot(x)+4*cot(x)-8*sec(x)*csc(x))

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 52, normalized size of antiderivative = 0.87 \[ \int \frac {\cot ^2(x)}{\left (a+a \tan ^2(x)\right )^{3/2}} \, dx=-\frac {{\left (8 \, \tan \left (x\right )^{4} + 12 \, \tan \left (x\right )^{2} + 3\right )} \sqrt {a \tan \left (x\right )^{2} + a}}{3 \, {\left (a^{2} \tan \left (x\right )^{5} + 2 \, a^{2} \tan \left (x\right )^{3} + a^{2} \tan \left (x\right )\right )}} \]

[In]

integrate(cot(x)^2/(a+a*tan(x)^2)^(3/2),x, algorithm="fricas")

[Out]

-1/3*(8*tan(x)^4 + 12*tan(x)^2 + 3)*sqrt(a*tan(x)^2 + a)/(a^2*tan(x)^5 + 2*a^2*tan(x)^3 + a^2*tan(x))

Sympy [F]

\[ \int \frac {\cot ^2(x)}{\left (a+a \tan ^2(x)\right )^{3/2}} \, dx=\int \frac {\cot ^{2}{\left (x \right )}}{\left (a \left (\tan ^{2}{\left (x \right )} + 1\right )\right )^{\frac {3}{2}}}\, dx \]

[In]

integrate(cot(x)**2/(a+a*tan(x)**2)**(3/2),x)

[Out]

Integral(cot(x)**2/(a*(tan(x)**2 + 1))**(3/2), x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 225 vs. \(2 (52) = 104\).

Time = 0.40 (sec) , antiderivative size = 225, normalized size of antiderivative = 3.75 \[ \int \frac {\cot ^2(x)}{\left (a+a \tan ^2(x)\right )^{3/2}} \, dx=\frac {{\left ({\left (\sin \left (5 \, x\right ) - \sin \left (3 \, x\right )\right )} \cos \left (8 \, x\right ) + 20 \, {\left (\sin \left (5 \, x\right ) - \sin \left (3 \, x\right )\right )} \cos \left (6 \, x\right ) + 10 \, {\left (9 \, \sin \left (4 \, x\right ) - 2 \, \sin \left (2 \, x\right )\right )} \cos \left (5 \, x\right ) - {\left (\cos \left (5 \, x\right ) - \cos \left (3 \, x\right )\right )} \sin \left (8 \, x\right ) - 20 \, {\left (\cos \left (5 \, x\right ) - \cos \left (3 \, x\right )\right )} \sin \left (6 \, x\right ) - {\left (90 \, \cos \left (4 \, x\right ) - 20 \, \cos \left (2 \, x\right ) - 1\right )} \sin \left (5 \, x\right ) - 90 \, \cos \left (3 \, x\right ) \sin \left (4 \, x\right ) - {\left (20 \, \cos \left (2 \, x\right ) + 1\right )} \sin \left (3 \, x\right ) + 90 \, \cos \left (4 \, x\right ) \sin \left (3 \, x\right ) + 20 \, \cos \left (3 \, x\right ) \sin \left (2 \, x\right )\right )} \sqrt {a}}{24 \, {\left (a^{2} \cos \left (5 \, x\right )^{2} - 2 \, a^{2} \cos \left (5 \, x\right ) \cos \left (3 \, x\right ) + a^{2} \cos \left (3 \, x\right )^{2} + a^{2} \sin \left (5 \, x\right )^{2} - 2 \, a^{2} \sin \left (5 \, x\right ) \sin \left (3 \, x\right ) + a^{2} \sin \left (3 \, x\right )^{2}\right )}} \]

[In]

integrate(cot(x)^2/(a+a*tan(x)^2)^(3/2),x, algorithm="maxima")

[Out]

1/24*((sin(5*x) - sin(3*x))*cos(8*x) + 20*(sin(5*x) - sin(3*x))*cos(6*x) + 10*(9*sin(4*x) - 2*sin(2*x))*cos(5*
x) - (cos(5*x) - cos(3*x))*sin(8*x) - 20*(cos(5*x) - cos(3*x))*sin(6*x) - (90*cos(4*x) - 20*cos(2*x) - 1)*sin(
5*x) - 90*cos(3*x)*sin(4*x) - (20*cos(2*x) + 1)*sin(3*x) + 90*cos(4*x)*sin(3*x) + 20*cos(3*x)*sin(2*x))*sqrt(a
)/(a^2*cos(5*x)^2 - 2*a^2*cos(5*x)*cos(3*x) + a^2*cos(3*x)^2 + a^2*sin(5*x)^2 - 2*a^2*sin(5*x)*sin(3*x) + a^2*
sin(3*x)^2)

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 55, normalized size of antiderivative = 0.92 \[ \int \frac {\cot ^2(x)}{\left (a+a \tan ^2(x)\right )^{3/2}} \, dx=-\frac {{\left (5 \, \tan \left (x\right )^{2} + 6\right )} \tan \left (x\right )}{3 \, {\left (a \tan \left (x\right )^{2} + a\right )}^{\frac {3}{2}}} + \frac {2}{{\left ({\left (\sqrt {a} \tan \left (x\right ) - \sqrt {a \tan \left (x\right )^{2} + a}\right )}^{2} - a\right )} \sqrt {a}} \]

[In]

integrate(cot(x)^2/(a+a*tan(x)^2)^(3/2),x, algorithm="giac")

[Out]

-1/3*(5*tan(x)^2 + 6)*tan(x)/(a*tan(x)^2 + a)^(3/2) + 2/(((sqrt(a)*tan(x) - sqrt(a*tan(x)^2 + a))^2 - a)*sqrt(
a))

Mupad [F(-1)]

Timed out. \[ \int \frac {\cot ^2(x)}{\left (a+a \tan ^2(x)\right )^{3/2}} \, dx=\int \frac {{\mathrm {cot}\left (x\right )}^2}{{\left (a\,{\mathrm {tan}\left (x\right )}^2+a\right )}^{3/2}} \,d x \]

[In]

int(cot(x)^2/(a + a*tan(x)^2)^(3/2),x)

[Out]

int(cot(x)^2/(a + a*tan(x)^2)^(3/2), x)